package org.i1510.common.servlet;

import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.session.mgt.SessionKey;
import org.i1510.common.utils.KBProperties;
import org.i1510.common.utils.StringUtils;
import org.i1510.common.utils.web.WebUtils;

import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;

/**
 * This Servlet does not do anything useful, just prints "Hello World!". The
 * intent is to help you to get started if you want to build your own Controller
 * servlet that uses FreeMarker for the View. For more advanced example, see the
 * 2nd Web application example.
 */
public class Rs_joeone extends HttpServlet {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
    
    public void init() {
    	
    }
    
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {
		
        resp.setContentType("text/html; charset=UTF-8" );//+ t.getEncoding()
        
        if(KBProperties.STARTSYS == 1){
        	req.getRequestDispatcher("/joeone/ipad/index_dhVote.jsp").forward(req, resp); 
    	}else if(KBProperties.STARTSYS == 0){
    		req.getRequestDispatcher("/joeone/ipad/index.jsp").forward(req, resp); 
    	}else{
    		req.getRequestDispatcher("/joeone/ipad/index.jsp").forward(req, resp); 
    	}
        
    }

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}
    
}